<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改词组(汉典)')" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-cizudb-edit" th:object="${cizuDb}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">词组：</label>
                <div class="col-sm-8">
                    <input name="ci" th:field="*{ci}" class="form-control" type="text" disabled="disabled">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">py：</label>
                <div class="col-sm-8">
                    <input name="py" th:field="*{py}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">pinyin：</label>
                <div class="col-sm-8">
                    <input name="pinyin" th:field="*{pinyin}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">同义词：</label>
                <div class="col-sm-8">
                    <input name="tongyici" th:field="*{tongyici}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">反义词：</label>
                <div class="col-sm-8">
                    <input name="fanyici" th:field="*{fanyici}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">注解：</label>
                <div class="col-sm-8">
                    <input id="zhujie" name="zhujie" th:field="*{zhujie}" type="hidden">
                    <div id="editor-zhujie" class="summernote"></div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">注解(full)：</label>
                <div class="col-sm-8">
                    <input id="fullZhujie" name="fullZhujie" th:field="*{fullZhujie}" type="hidden">
                    <div id="editor-fullZhujie" class="summernote"></div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">解释(汉典)：</label>
                <div class="col-sm-8">
                    <input id="jieshi" name="jieshi" th:field="*{jieshi}" type="hidden">
                    <div id="editor-jieshi" class="summernote"></div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">古语词典：</label>
                <div class="col-sm-8">
                    <input id="gycd" name="gycd" th:field="*{gycd}" type="hidden">
                    <div id="editor-gycd" class="summernote"></div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js" />
    <script type="text/javascript">
        var prefix = ctx + "dict/cizudb";

        $(function() {
		    $('.summernote').summernote({
		    	placeholder: '请输入内容',
		    	height : 400,
				lang : 'zh-CN',
				followingToolbar: false,
				callbacks: {
	                onImageUpload: function (files) {

	                }
	            }
		    });
		    $('#editor-zhujie').summernote('code', $("#zhujie").val());
		    $('#editor-fullZhujie').summernote('code', $("#fullZhujie").val());
		    $('#editor-jieshi').summernote('code', $("#jieshi").val());
		    $('#editor-gycd').summernote('code', $("#gycd").val());
	    });

        $("#form-cizudb-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-cizudb-edit').serialize());
            }
        }
    </script>
</body>
</html>